<!DOCTYPE html>
<!-- 
Template Name: Metronic - Responsive Admin Dashboard Template build with Twitter Bootstrap 3.1.1
Version: 2.0.2
Author: KeenThemes
Website: http://www.keenthemes.com/
Contact: support@keenthemes.com
Purchase: http://themeforest.net/item/metronic-responsive-admin-dashboard-template/4021469?ref=keenthemes
License: You must have a valid license purchased only from themeforest(the above link) in order to legally use the theme for your project.
-->
<!--[if IE 8]> <html lang="en" class="ie8 no-js"> <![endif]-->
<!--[if IE 9]> <html lang="en" class="ie9 no-js"> <![endif]-->
<!--[if !IE]><!-->
<!--<![endif]-->
<!-- BEGIN HEAD -->
<!-- BEGIN BODY -->
<body class="page-header-fixed">
<!-- BEGIN PAGE CONTENT-->
			<div class="site_content">
				<div class="realtime_content content_box no_table_filter">
					<div>
						<form class="instruct_box" id="formid" method="post">
							<hr />
							<div>
			                    <div class="form-group form1 row">
			                    	<div class="col-sm-6">
				                        <label class="col-sm-4">设备地址</label>
				                        <div class="col-sm-8">
				                        	<input type="text" class="form-control" id="chargerId" name="chargerId" placeholder="请输入16位设备地址">
				                        </div>
			                        </div>
			                        <div class="col-sm-6">
				                        <label class="col-sm-4">用户卡号</label>
				                        <div class="col-sm-8">
				                        	<input type="text" class="form-control" id="userCard" name="userCard" placeholder="请输入20位用户卡号">
				                        </div>
				                        <span class="textspan">例如：01234567890123456789</span>
			                        </div>
			                    </div>
			                    <div class="form-group form1 row">
			                    	<div class="col-sm-6">
				                        <label class="col-sm-4">充电口号</label>
				                        <div class="col-sm-8">
				                        	<input type="text" class="form-control" id="portNo" name="portNo" placeholder="请输入充电口号">
				                        </div>
				                        <span class="textspan">例如：00，01等</span>
			                        </div>
			                        <div class="col-sm-6">
				                        <label class="col-sm-4">控制类型</label>
				                        <div class="col-sm-8">
				                        	<input type="text" class="form-control" id="controlType" name="controlType"  placeholder="请输入控制类型">
				                        </div>
				                        <span class="textspan">例如：</span>
			                        </div>
			                    </div>
			                    <div class="form-group form1 row">
			                    	<div class="col-sm-6">
				                        <label class="col-sm-4">开启限制数据</label>
				                        <div class="col-sm-8">
				                        	<input type="text" class="form-control" id="limit_data" name="limit_data" placeholder="请输入限制数据">
				                        </div>
				                        <span class="textspan">例如：</span>
			                        </div>
			                        <div class="col-sm-6">
				                        <label class="col-sm-4">定时启动</label>
				                        <div class="col-sm-8">
				                        	<input type="text" class="form-control" id="time_start" name="time_start" placeholder="请输入定时启动">
				                        </div>
				                        <span class="textspan">例如：如果无效请输入8个0，有效按照月日时分来输入</span>
			                        </div>
			                    </div>
			                    <div class="form-group form1 row">
			                    	<div class="col-sm-6">
				                        <label class="col-sm-4">版本号</label>
				                        <div class="col-sm-8">
				                        	<select class="form-control" id="protocol_version" name="protocol_version" >
												<option value="0101">0101</option>
												<option value="0102">0102</option>
												<option value="0103" selected="">0103</option>
											</select>
				                        </div>
			                        </div>
			                    </div>
		                    </div>
		                    <div class="modal-footer t_c">
								<button type="reset" class="btn btn-warning" data-dismiss="modal"><i class="fa fa-refresh"></i> 重置</button>
								<button type="button" class="btn btn-danger"><i class="fa fa-times-circle"></i> 关闭</button>
								<button type="button" class="btn btn-primary"><i class="fa fa-check-circle-o"></i> 开启</button>
							</div>
	                    </form>
					</div>
				</div>
			</div>
			<!-- END PAGE CONTENT-->
</body>
<script>
$('button.btn-primary').on('click',function(){
	$.ajax({
		type:'post',
		//url:'../../userApi/login',
		url:'../chargeControll/startCharge',
		//data:{"chargerId":$('#chargerId').val(),"portNo":$('#portNo').val(),"userCard":$('#userCard').val()},
		data:$('#formid').serialize(),
		dataType: "json",
		async: false,
		success:function(data){
			if(data.code == '200'){
				bootboxWindow.alert("指令下发成功!", null);
			}else{
				bootboxWindow.alert("指令下发失败!", null);
				$('#account').val('');
				$('#password').val('');
			}
		}
	})
});
$('button.btn-danger').on('click',function(){
	$.ajax({
		type:'post',
		//url:'../../userApi/login',
		url:'../chargeControll/stopCharge',
		//data:{"chargerId":$('#chargerId').val(),"portNo":$('#portNo').val(),"userCard":$('#userCard').val()},
		data:$('#formid').serialize(),
		dataType: "json",
		async: false,
		success:function(data){
			if(data.code == '200'){
				bootboxWindow.alert("指令下发成功!", null);
			}else{
				bootboxWindow.alert("指令下发失败!", null);
				$('#account').val('');
				$('#password').val('');
			}
		}
	})
});
</script>
</html>
